package com.egao.gzh.entity.reply;

import com.thoughtworks.xstream.annotations.XStreamAlias;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @author Damon
 * @create 2020-08-26 16:27
 */
@XStreamAlias("xml")
public class NewsMessage extends BaseMessage {
    public NewsMessage(Map<String, String> requestMap, List<Article> article) {
        super(requestMap);
        setMsgType("news");
        this.article = article;
        if(article != null && article.size() > 0) {
            this.articleCount = article.size() +"";
        } else {
            this.articleCount = "0";
        }
    }

    @XStreamAlias("Articles")
    private List<Article> article = new ArrayList<>();
    @XStreamAlias("ArticleCount")
    private String articleCount;

    public List<Article> getArticle() {
        return article;
    }

    public void setArticle(List<Article> article) {
        this.article = article;
    }

    public String getArticleCount() {
        return articleCount;
    }

    public void setArticleCount(String articleCount) {
        this.articleCount = articleCount;
    }
}
